package com.usian.admin.controller.v1;

import com.usian.admin.service.AdChannelService;
import com.usian.admin.service.AdSensitiveService;
import com.usian.apis.admin.AdChannelControllerApis;
import com.usian.apis.admin.AdSensitiveControllerApis;
import com.usian.model.admin.dtos.ChannelDto;
import com.usian.model.admin.dtos.SensitiveDto;
import com.usian.model.admin.pojos.AdChannel;
import com.usian.model.admin.pojos.AdSensitive;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/sensitive")
public class AdSensitiveController implements AdSensitiveControllerApis {

    @Autowired
    private AdSensitiveService adSensitiveServiceI;

    @Override
    @PostMapping("list")
    public ResponseResult findListPage(@RequestBody SensitiveDto dto) {

        return adSensitiveServiceI.findListPage(dto);
    }

    @Override
    @PostMapping("save")
    public ResponseResult insert(@RequestBody AdSensitive adSensitive) {
        return adSensitiveServiceI.insert(adSensitive);
    }

    @Override
    @PostMapping("update")
    public ResponseResult update(@RequestBody AdSensitive adSensitive) {
        return adSensitiveServiceI.updateAdSensitive(adSensitive);
    }

    @Override
    @DeleteMapping("/del/{id}")
    public ResponseResult delete(@PathVariable Integer id) {
        return adSensitiveServiceI.deleteAdSensitive(id);
    }
}
